unit Unit2; 

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls,Unit1;

type

  { TForm2 }

  TForm2 = class(TForm)
    btnPath: TButton;
    btnBack: TButton;
    Edit1: TEdit;
    Label1: TLabel;
    pathDialog: TOpenDialog;
    procedure btnBackClick(Sender: TObject);
    procedure btnPathClick(Sender: TObject);
    procedure FormResize(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end; 

var
  Form2: TForm2; 

implementation

{ TForm2 }

procedure TForm2.btnPathClick(Sender: TObject);
begin
  if pathDialog.Execute then
  compilername:=pathDialog.FileName;
  Edit1.Text:=compilername;
  directory:=ExtractFilePath(compilername);
  chdir(directory);
end;

procedure TForm2.FormResize(Sender: TObject);
begin
  Form2.Height:=137;
  Form2.Width:=371;
  Form2.Left:=round((Form1.Width/2)+Form1.Left);
  Form2.Top:=round((Form1.Height/2)+Form1.Top);
end;

procedure TForm2.btnBackClick(Sender: TObject);
begin
  compilername:=Edit1.Text;
  Form2.Close;
   if (compilername<>'') and (dateiname <>'') then
           begin
           Form1.speedCompile.Enabled:=True;
           Form1.menuCompile.Enabled:=True;
           end;
end;

initialization
  {$I Unit2.lrs}

end.

